<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->config->item('charset');?>">
        <title>友情链接管理</title>
        <link rel="stylesheet" href="<?php echo base_url();?>public/js/kindeditor-4.1.2/themes/default/default.css" />
        <script lang='javascript' src='<?php echo base_url();?>public/js/kindeditor-4.1.2/kindeditor.js'></script>
        <script lang='javascript' src='<?php echo base_url();?>public/js/kindeditor-4.1.2/lang/zh_CN.js'></script>
        <script language='javascript'>
            function CheckSubmit()
            {
                if(document.form1.url.value=="http://"||document.form1.url.value=="")
                    {
                    document.form1.url.focus();
                    alert("网址不能为空！");
                    return false;
                }
                if(document.form1.webname.value=="")
                    {
                    document.form1.webname.focus();
                    alert("网站名称不能为空！");
                    return false;
                }
                return true;
            }
            
            
              KindEditor.ready(function(K) {
                    var editor = K.editor({
                            allowFileManager : true
                    });
                    K('#image1').click(function() {
                            editor.loadPlugin('image', function() {
                                    editor.plugin.imageDialog({
                                            imageUrl : K('#logo').val(),
                                            clickFn : function(url, title, width, height, border, align) {
                                                K('#logo').val(url);
                                                editor.hideDialog();
                                            }
                                    });
                            });
                    });
            });
            
        </script>

        <link href="<?php echo base_url();?>public/css/base.css" rel="stylesheet" type="text/css">
    </head>
    <body leftmargin='8' topmargin='8'>
        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
            <tr>
                <td height="28" background="<?php echo base_url();?>public/images/tbg.gif" style="padding-left:10px;"><b><a href="friendlink_main.php"><u>友情链接管理</u></a></b>&gt;&gt;增加链接</td>
            </tr>
            <tr>
                <td height="200" bgcolor="#FFFFFF" valign="top">
                    <form action="<?php echo site_url("admin/friendlink/save"); ?>" method="post" name="form1" onSubmit="return CheckSubmit();";>
                    <input type="hidden" name="dopost" value="add" />
                    <table width="80%"  border="0" cellspacing="1" cellpadding="3">
                        <tr>
                            <td width="19%" height="25">网址：</td>
                            <td width="81%">
                                <input name="url" type="text" id="url" value="http://" size="30" class='pubinputs' />
                            </td>
                        </tr>
                        <tr>
                            <td height="25">网站名称：</td>
                            <td>
                                <input name="webname" type="text" id="webname" size="30" class='pubinputs' />
                            </td>
                        </tr>
                        <tr>
                            <td width="19%" height="25">排列位置：</td>
                            <td width="81%">
                                <input name="sortrank" type="text" id="sortrank" value="1" size="10" class='pubinputs' style='width:60px' />
                                (由小到大排列)
                            </td>
                        </tr>
                        <tr>
                            <td height="25">网站Logo：</td>
                            <td>
                               <input name="logo" type="text" id="logo" style="width:260px" value="" size="16"/><input type="button" id="image1" value="选择图片" />
                                (88*31 gif或jpg)
                            </td>
                        </tr>

                        <tr>
                            <td height="25">网站简况：</td>
                            <td><textarea name="msg" cols="50" rows="4" id="msg"></textarea></td>
                        </tr>
                        <tr>
                            <td height="25">站长Email：</td>
                            <td>
                                <input name="email" type="text" id="email" size="30" class='pubinputs' />
                            </td>
                        </tr>
                        <tr>
                            <td height="25">网站类型：</td>
                            <td>
                                <select name="typeid" id="typeid">
                                    <?php
                                        foreach ($art_list->result() as $arcatt)
                                        {
                                            echo " <option value='".$arcatt->id."'>".$arcatt->typename."</option>";   
                                        }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td height="25">链接位置：</td>
                            <td>
                                <input type='radio' name='ischeck' value="1" checked='1' /> 内页
                                <input type='radio' name='ischeck' value="2"/> 首页
                            </td>
                        </tr>
                        <tr>
                            <td height="51">&nbsp;</td>
                            <td>
                                <input type="submit" name="Submit" value=" 提 交 " class="coolbg np" />　 　
                                <input type="reset" name="Submit" value=" 重 置 " class="coolbg np" />
                            </td>
                        </tr>
                    </table>
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>